using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Collections;
using System.Text.RegularExpressions;

namespace SMS.SportAutoService
{
    /// <summary>
    /// Summary description for dataControler
    /// </summary>
    public class DataControler
    {
        SqlDataprovider dataProviders;
        public DataControler()
        {
            dataProviders = new SqlDataprovider();
        }

        public int getMaxContent(int idCS)
        {
            return dataProviders.getMaxConten(idCS);
        }

        public int getContentNumberFromMessage(int idMessage)
        {
            return dataProviders.getContentNumberFromMessage(idMessage);
        }

        public int getIdContentMaxFromMessage(int idMessage)
        {
            return dataProviders.getIdContentMaxFromMessage(idMessage);
        }

        public void closeMessage(int idMessage, int idContent)
        {
            dataProviders.closeMessage(idMessage, idContent);
        }

        public int getMessageType(int idCS)
        {
            return dataProviders.getMessageType(idCS);
        }

        public void createMessageContent(int messageId, int contentNumber, string messageContent, int userCreate)
        {
            dataProviders.createMessageContent(messageId, contentNumber, messageContent, userCreate);
        }

        public int createMessage(int commanServiceId,string service_number, string leagueCode, string homeCode, string awayCode, string mainCode, string expandCode, int leagueLevel, int userId)
        {
            return dataProviders.createMessage(commanServiceId,service_number, leagueCode, homeCode, awayCode, mainCode, expandCode, leagueLevel, userId);
        }

        public int getCommandServiceOption(int idCS, int idOption)
        {
            return dataProviders.getCommandServiceOption(idCS, idOption);
        }

        public void deleteContentMessage(int contentNumber, int idMessage)
        {
            dataProviders.deleteContentMessage(contentNumber, idMessage);
        }

        public ArrayList getContentList(int idMessage)
        {
            return CBO.FillCollection(dataProviders.getContentList(idMessage), typeof(ContentObject));
        }

        public ArrayList getMessageByMessageId(int messageId)
        {
            return CBO.FillCollection(dataProviders.getMessageByMessageId(messageId), typeof(MessageObject));
        }

        public int getCounter(int idMessage)
        {
            return dataProviders.getUpdateCount(idMessage);
        }

        public void updateCount(int counter, int idMessage)
        {
            dataProviders.updateCounter(counter, idMessage);
        }

        public int checkCloseMessage(int idMessage)
        {
            int temp = Convert.ToInt32(dataProviders.checkCloseMessage(idMessage));

            return temp;
        }

        public void updateContentMessage(int idContent, int idMessage, string contentMessage, int userId)
        {
            dataProviders.updateContentMessage(idContent, idMessage, contentMessage, userId);
        }
    }
}